Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PERF: DataFrame.join with how=left|right and sort=True #56919

Merged
merged 3 commits into from
Jan 17, 2024

Conversation

lukemanley
Copy link
Member

@lukemanley lukemanley commented Jan 17, 2024

import pandas as pd

data = [f"i-{i}" for i in range(200_000)]
idx1 = pd.Index(data, dtype="string[pyarrow_numpy]")
idx2 = pd.Index(data[1:], dtype="string[pyarrow_numpy]")

%timeit idx1.join(idx2, how="left", sort=True)

# 330 ms ± 6.3 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)     -> main
# 182 ms ± 2.68 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)  -> PR

@lukemanley lukemanley added Performance Memory or execution speed performance Reshaping Concat, Merge/Join, Stack/Unstack, Explode labels Jan 17, 2024
@lukemanley lukemanley added this to the 3.0 milestone Jan 17, 2024
@mroeschke mroeschke merged commit c7cc22a into pandas-dev:main Jan 17, 2024
50 checks passed
@mroeschke
Copy link
Member

Thanks @lukemanley

pmhatre1 pushed a commit to pmhatre1/pandas-pmhatre1 that referenced this pull request May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Performance Memory or execution speed performance Reshaping Concat, Merge/Join, Stack/Unstack, Explode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants